package cn.tedu.huntingmall.pojo.dto.shoppingcart;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.extern.slf4j.Slf4j;

import javax.validation.constraints.NotNull;
import java.io.Serializable;

@Data
@Slf4j
public class ShoppingCartAddNewDTO implements Serializable {

    /**
     * 验证请求参数失败的描述文本前缀
     */
    private static final String VALIDATE_MESSAGE_PREFIX = "新增商品到购物车失败，";


    @ApiModelProperty(value = "商品id", required = true)
    @NotNull(message = VALIDATE_MESSAGE_PREFIX + "必须添加商品id!")
    private Long commodityId;

    @ApiModelProperty(value = "商品标题", required = true)
    @NotNull(message = VALIDATE_MESSAGE_PREFIX + "必须添加商品标题!")
    private String title;

    @ApiModelProperty(value = "商品图片url地址", required = true)
    @NotNull(message = VALIDATE_MESSAGE_PREFIX + "必须添加商品图片url地址!")
    private String imgUrl;

    @ApiModelProperty(value = "商品价格", required = true)
    @NotNull(message = VALIDATE_MESSAGE_PREFIX + "必须添加商品价格!")
    private Double price;

    @ApiModelProperty(value = "商品数量", required = true)
    @NotNull(message = VALIDATE_MESSAGE_PREFIX + "必须添加商品数量!")
    private Integer count;

    @ApiModelProperty(value = "用户姓名", required = true)
    @NotNull(message = VALIDATE_MESSAGE_PREFIX + "必须添加用户姓名!")
    private String username;

}
